home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / UTIL / Cron 1.0a7.sit / Cron Distribution / Documentation / crontab (example) < prev    next >
Text File  |  1996-05-27  |  3KB  |  86 lines

  1. //    Here's an example crontab file, based on some functions I've 
  2. //    found useful on my own Mac from time to time.
  3. //    
  4. //    
  5. //    QuickRef: The fields of a crontab entry specify the following:
  6. //
  7. //    Field    Meaning
  8. //    -----    ------------------------------------------------------
  9. //      1        Minute (0-59)
  10. //      2        Hour (0-23)
  11. //      3        Day of the month (1-31)
  12. //      4        Month of the year (1-12)
  13. //      5        Day of the week (1-7, with 1=Monday)
  14. //      6        User name (unused)
  15. //      7+    Command name and arguments (if command is preceded by 
  16. //            "-b" cron executes it in the background).
  17.  
  18.  
  19.  
  20. //    We include this line to prove to the first time Cron user that 
  21. //    Cron actually works.
  22.  
  23. startup 0 : * * * * * nobody echo "Cron is alive and well."
  24.  
  25.  
  26.  
  27. //    Launch the Eudora mailer in the background at 8:40 AM every 
  28. //    weekday so my mail will be waiting for me when I arrive.
  29.  
  30. 40 8 * * 1-5 nobody -b CSOm
  31.  
  32.  
  33.  
  34. //    Get the correct date & time from one of several TCP-based Time 
  35. //    Protocol servers on the network. Do this at 3:00 every morning. 
  36. //    Note that MacTCP is required, and the Map control panel must be 
  37. //    set to the correct local time zone for this to work properly.
  38. //    
  39. //    Remember to use the -d option if you live in a part of the USA
  40. //    that conforms to the Daylight Savings Time (DST) convention.
  41. //    
  42. //    We select 3:00 AM because the change to/from DST occurs at 
  43. //    2:00 AM, and waiting a further hour guarantees that the change 
  44. //    will be caught in a (relatively) timely manner even if the Mac's 
  45. //    clock is running as much as an hour fast. Of course, you could 
  46. //    just call the server a lot more often, but it seems kind of 
  47. //    pointless.
  48.  
  49. 0 3 * * * nobody -b "udp time client" -ld ntp1.utexas.edu ntp2.utexas.edu hermes.chpc.utexas.edu apple.com nic.ddn.mil
  50.  
  51. //    If the Mac's clock chip loses power for some reason, it will 
  52. //    revert to Friday, January 1st, 1904, 12:00 AM. We'll anticipate 
  53. //    that problem by invoking the time client several times during 
  54. //    the hour of midnight on a January 1st which falls on a Friday. 
  55. //    We can't test for the year, of course, so we only want to make 
  56. //    a couple of checks, lest the time servers be flooded with 
  57. //    requests when the aformentioned criteria are met naturally.
  58.  
  59. 0,2,4,6 0 1 1 5 nobody -b "udp time client" -ld ntp1.utexas.edu ntp2.utexas.edu hermes.chpc.utexas.edu apple.com nic.ddn.mil
  60.  
  61.  
  62.  
  63. //    The following lines attempt to reboot my Mac at approximately 
  64. //    4 AM every morning, so that it can start the day fresh.  The 
  65. //    redundant shutdown calls will have no effect unless someone in 
  66. //    the office using my Mac has cancelled one of the previous calls.  
  67. //    Since all these shutdown calls use the -i (interactive) option, 
  68. //    the user can conceivably cancel them all and go on working 
  69. //    uninterrupted, but, hopefully, theyユll get the idea....
  70. //    
  71. //    The -d option forces the desktops on all mounted volumes (where 
  72. //    applicable) to be deleted, which causes the Finder to rebuild 
  73. //    them when the system comes back up. Note that all "Get Info" 
  74. //    comments are lost when using the -d option, even if you're using
  75. //    System 7.5.3 or better.
  76.  
  77. 50 3 * * * nobody shutdown -ird 600 "Please prepare for the nightly system restartノ"
  78. 55 3 * * * nobody shutdown -ird 300 "Please prepare for the nightly system restartノ"
  79. 58 3 * * * nobody shutdown -ird 120 "Please prepare for the nightly system restartノ"
  80. 59 3 * * * nobody shutdown -ird 60 "Please prepare for the nightly system restartノ"
  81.  
  82.  
  83.  
  84.  
  85.  
  86.